package com.rikkathewrold.rikkamusic.greendao.db;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.rikkathewrold.rikkamusic.search.bean.SearchHistoryBean;
import com.rikkathewrold.rikkamusic.main.bean.DRGreenDaoBean;

import com.rikkathewrold.rikkamusic.greendao.db.SearchHistoryBeanDao;
import com.rikkathewrold.rikkamusic.greendao.db.DRGreenDaoBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig searchHistoryBeanDaoConfig;
    private final DaoConfig dRGreenDaoBeanDaoConfig;

    private final SearchHistoryBeanDao searchHistoryBeanDao;
    private final DRGreenDaoBeanDao dRGreenDaoBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        searchHistoryBeanDaoConfig = daoConfigMap.get(SearchHistoryBeanDao.class).clone();
        searchHistoryBeanDaoConfig.initIdentityScope(type);

        dRGreenDaoBeanDaoConfig = daoConfigMap.get(DRGreenDaoBeanDao.class).clone();
        dRGreenDaoBeanDaoConfig.initIdentityScope(type);

        searchHistoryBeanDao = new SearchHistoryBeanDao(searchHistoryBeanDaoConfig, this);
        dRGreenDaoBeanDao = new DRGreenDaoBeanDao(dRGreenDaoBeanDaoConfig, this);

        registerDao(SearchHistoryBean.class, searchHistoryBeanDao);
        registerDao(DRGreenDaoBean.class, dRGreenDaoBeanDao);
    }
    
    public void clear() {
        searchHistoryBeanDaoConfig.clearIdentityScope();
        dRGreenDaoBeanDaoConfig.clearIdentityScope();
    }

    public SearchHistoryBeanDao getSearchHistoryBeanDao() {
        return searchHistoryBeanDao;
    }

    public DRGreenDaoBeanDao getDRGreenDaoBeanDao() {
        return dRGreenDaoBeanDao;
    }

}
